#ifndef INTEGEROBJECT_H
#define INTEGEROBJECT_H

#include "Object.h"
#include "Type.h"
#include "List.h"

typedef struct Integer{
	OBJECT_HEAD
	int value;
}Integer;

//Integer的方法
void int_init(Integer*, int);
Integer* int_allocate(int i);
Integer* int_allocate_const(int i);

Integer* int_allocate_instance(Object*);

//虚函数的实现
Object* addInteger(Object*, Object*);

Object* subInteger(Object* self, Object* other);

Object* divInteger(Object* self, Object* other);

Object* mulInteger(Object* self, Object* other);


//比较运算
Object *equalInteger(Object *self, Object *other);

Object *notEqualInteger(Object *self, Object *other);

Object *greaterInteger(Object *self, Object *other);

Object *lessInteger(Object *self, Object *other);

Object *greaterEqualInteger(Object *self, Object *other);

Object *lessEqualInteger(Object *self, Object *other);


void printInteger(Object* self);
int hashInteger(Object* self);


Object* pvm_int_init(List* args);


//定义了一个全局的IntegerType变量并初始化，存放在数据段。

extern Type IntegerType;


/*@pvm启动时需要初始化Integer
* 该函数将Integer的方法在虚拟机启动时全都装填进IntegerType
pvm_start_init_integer
*/

void pvm_init_integer();
#endif
